/*
Copyright 2022 The Numaproj Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Code generated by Openapi Generator. DO NOT EDIT.

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct RateLimit {
    /// Max is the maximum TPS that this vertex can process give a distributed `Store` is configured. Otherwise, it will be the maximum TPS for a single replica.
    #[serde(rename = "max", skip_serializing_if = "Option::is_none")]
    pub max: Option<i64>,
    /// Minimum TPS allowed during initial bootup. This value will be distributed across all the replicas if a distributed `Store` is configured. Otherwise, it will be the minimum TPS for a single replica.
    #[serde(rename = "min", skip_serializing_if = "Option::is_none")]
    pub min: Option<i64>,
    #[serde(rename = "modes", skip_serializing_if = "Option::is_none")]
    pub modes: Option<Box<crate::models::RateLimiterModes>>,
    #[serde(rename = "rampUpDuration", skip_serializing_if = "Option::is_none")]
    pub ramp_up_duration: Option<kube::core::Duration>,
    /// ResumedRampUp is used to enable the resume mode for rate limiting.  This, if true, will allow the processor to resume the ramp-up process from the last known state of the rate limiter, i.e., if the processor was allowed X tokens before shutting down, it will be allowed X tokens again after the processor restarts.  The resumed ramp-up process will be allowed until TTL time after the processor first deregisters with the rate limiter.
    #[serde(rename = "resumedRampUp", skip_serializing_if = "Option::is_none")]
    pub resumed_ramp_up: Option<bool>,
    #[serde(rename = "store", skip_serializing_if = "Option::is_none")]
    pub store: Option<Box<crate::models::RateLimiterStore>>,
    #[serde(rename = "ttl", skip_serializing_if = "Option::is_none")]
    pub ttl: Option<kube::core::Duration>,
}

impl RateLimit {
    pub fn new() -> RateLimit {
        RateLimit {
            max: None,
            min: None,
            modes: None,
            ramp_up_duration: None,
            resumed_ramp_up: None,
            store: None,
            ttl: None,
        }
    }
}
